#ifndef THREADDATA_H
#define THREADDATA_H
#pragma once

#include <functional>
#include "countdownlatch.h"
#include "../prohibitassignment.h"

/**
 * 线程数据类
 * @brief The ThreadData class
 */
class ThreadData: public ProhibitAssignment
{
public:
    typedef std::function<void()> ThreadFunction;

    explicit ThreadData(const ThreadFunction & function, pid_t *processId, std::string &name, CountDownLatch *countDown);

    void runInThread();

private:
    // 线程名字
    std::string  name;

    // 进程编号
    pid_t *processId;

    // 进程回调函数
    ThreadFunction function;

    // 倒计时门闩
    CountDownLatch *countDown;
};

#endif // THREADDATA_H
